<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>党建网</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="alternate icon" type="image/png" href=",,/,,/assets/i/favicon.png">
<link rel="stylesheet" href="../../assets/css/amazeui.css"/>
<link rel="stylesheet" href="../../assets/css/admin.css">
<!--[if (gte IE 9)|!(IE)]><!-->
<script src="../../assets/js/jquery.min.js"></script>
<!--<![endif]-->
<script src="../../assets/js/amazeui.min.js"></script>
<script src="../../js/left-nav.js"></script>
<script src="../../js/header.js"></script>
<script src="../../js/jquery.pagination.js"></script>
<script src="../../js/index.js"></script>
<script src="../../js/global.js"></script>
<script src="../../js/md5.js"></script>
<style>
.header {
	text-align: center;
}

.header h1 {
	font-size: 200%;
	color: #333;
	margin-top: 30px;
}

.header p {
	font-size: 14px;
}

.form {
	padding: 40px;
	box-shadow: 1px 2px 8px #BD2D30;
}
</style>
</head>
<body>
	<div class="header">
		<div class="am-g">
			</br>
			</br>
			</br>
			<h1>计算机与信息工程学院党建工作网</h1>
		</div>
	</div>
	<div class="am-g">
		<div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
			<hr />
			<div class="form">
				<form class="am-form">
					<label for="admUsername">用户名:</label> <input type="text" name="" id="username_ipt" value="" placeholder="请输入用户名">  <label for="admPwd">密码:</label> <input type="password" name=""
						id="pwd_ipt" value="" placeholder="请输入密码"> <br> <label for="remember-me"> <input id="remember-me" type="checkbox"> 记住密码
					</label> <br />
					<div class="am-cf">
						<input type="button" id="login_btn" style="width:100px" value="登 录" class="am-btn am-btn-primary am-btn-sm am-fl">
					<input type="button" id="re_btn" style="width:100px;margin-left:20px" value="重置" class="am-btn am-btn-defult am-btn-sm am-fl">
					
					</div>
				</form>
			</div>
			<hr />
		</div>
	</div>
</body>
<script type="text/javascript">

	document.onkeydown = function(event){  
        event = event?event:window.event;  
        if (event.keyCode == 13) {  
            $("#login_btn").click();  
        }  
    };  
	/* 注册点击登陆按钮事件 */
	$("#login_btn").click(function login() {

		var admUsername = $("#username_ipt").val();
		if (admUsername == "") {
			alertModal("提示", "用户名未填写");
			return false;
		}

		var admPwd = $("#pwd_ipt").val();
		if (admPwd == "") {
			alertModal("提示", "密码未填写");
			return false;
		}

		var content = {};
		content["admName"] = admUsername;
		content["admPwd"] = admPwd;

		$.ajax({
			type : "POST",
			url : "/partyBuilding/admin/login",
			data : encrypt(content),
			contentType : "application/json",
			dataType : "json",
			success : function(data) {
				//ALERT(JSON.stringify(data));
				if (data.code == "200") {
					setCookie("admUsername",admUsername);
					
					// 跳转进入后台
					window.location.href = "/partyBuilding/back/index/index.html";
				} else {
					alertModal("警告", data.message);
				}
			},
			error : function() {
				alertModal("警告", "服务器开小差了");
			}
		});
	});
</script>
</html>
